package ooday03Exercise;

public class Test {
    public static void main(String[] args) {
        Dog[] dog=new Dog[3];
        dog[0]=new Dog("小黑",2,"黑色");
        dog[1]=new Dog("小白",1,"白色");
        dog[2]=new Dog("金毛",1,"金色");
        for(int i=0;i<dog.length;i++){
            System.out.println(dog[i].name);
            dog[i].swim();
            dog[i].eat();
        }

        Chick[] chicks=new Chick[2];
        chicks[0]=new Chick("小花",2,"棕色");
        chicks[1]=new Chick("黄鸡",1,"黄色");
        for (int i=0;i<chicks.length;i++){
            System.out.println(chicks[i].name);
            chicks[i].layEggs();
        }

        Fish[] fish=new Fish[2];
        fish[0]=new Fish("鲤鱼",2,"白色");
        fish[1]=new Fish("黑鱼",1,"黑色");
        for (int i=0;i<fish.length;i++){
            System.out.println(fish[i].name);
            fish[i].eat();
        }





    }
}
